package com.woniu.his.sms.client;

import com.woniu.his.result.Result;
import com.woniu.his.sms.client.param.CreateStafffParam;
import com.woniu.his.sms.client.param.SmsSkdDocParam;
import com.woniu.his.sms.client.param.StaffLoginParam;
import com.woniu.his.sms.client.param.StaffPageParam;
import com.woniu.his.sms.client.param.StaffUpdateParam;
import com.woniu.his.sms.client.result.PageStaffResult;
import com.woniu.his.sms.client.result.StaffAllResult;
import com.woniu.his.sms.client.result.StaffResult;
import com.woniu.his.sms.client.result.LoginStaffResult;
import com.woniu.his.sms.client.param.StaffPwdParam;
import com.woniu.his.sms.client.result.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.executable.ValidateOnExecution;
import java.util.List;

/**
 * name是项目名，contextId是client的名字
 */
@FeignClient(contextId = "smsStaffClient", name = "sms", path = "sms")
@Validated
public interface SmsStaffClient {

    /**
     * @Description: 根据日期上下午查询上班医生
     * @Param: daixin
     * @return:
     * @Date: 2022/11/25
     */
    @PostMapping("/listDocBySkd")
    public Result<List<StaffResult>> listDocBySkd(@RequestBody SmsSkdDocParam smsSkdDocParam);


    /**
     * @Description: 根据登录id获取登录用户
     * @Param: daixin
     * @return:
     * @Date: 2022/11/26
     */
    @GetMapping("/findLoginStaffById")
    public Result<LoginStaffResult> findLoginStaffById(@RequestParam("staffId") Integer staffId);


    /**
     * @Description: 根据用户名密码查找用户
     * @Param: dx
     * @return:
     * @Date: 2022/11/26
     */
    @PostMapping("/findStaffByPwd")
    public Result<LoginStaffResult> findStaffByPwd(@RequestBody StaffPwdParam staffPwdParam);

    /**
     * @Description: 根据用ids 删除员工用户
     * @Param: dx
     * @return:
     * @Date: 2022/11/26
     */
    @PostMapping("/deleteStaff")
    public Result deleteStaff(@RequestBody List<Long> ids);


    //模糊查询用户。且分页
    @PostMapping("/QueryPageStaff")
    public Result<PageStaffResult> QueryPageStaff(@RequestBody StaffPageParam param);

    /**
     * @Description: 新增用户
     * @Param: dx
     * @return:
     * @Date: 2022/11/26
     */
    @PostMapping("/createStaff")
    public Result<CreateStaffResult> createStaff(@RequestBody CreateStafffParam createStafffParam);


    //查询所有用户
    @PostMapping("/QueryAll")
    public Result<List<StaffAllResult>> QueryAll();

    //更新用户信息
    @PostMapping("/UpdateStaff")
    public Result UpdateStaff(@RequestBody StaffUpdateParam param);

    /**
     * 登录返回token
     *
     * @param loginParam
     * @return
     */
    @PostMapping("/login")
    public Result<String> login(@Validated @RequestBody StaffLoginParam loginParam);

    /**
     * 找到所有员工按科室id
     *
     * @param deptId
     * @return {@link Result}<{@link List}<{@link String}>>
     */
    @GetMapping("findAllStaffByDeptId")
    public Result<List<StaffInfoResult>> findAllStaffByDeptId(@RequestParam("deptId") Integer deptId);


}
